# pragma once

#include "Packet.h"
#include "StackUtils.h"

#include <string>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>

class IProtocol
{
	public:
		friend class boost::serialization::access;
		virtual StackUtils::e_Status Decode(CPacket& packet) = 0;
		virtual StackUtils::e_Status Encode(CPacket& packet) = 0;
		const std::string& getName() const { return name; }

		template<class Archive> 
		void serialize(Archive & ar, const unsigned int version) 
		{
			ar & name;
		}

		virtual ~IProtocol(void) 
		{

		}

	protected:
		std::string name;		
};

BOOST_SERIALIZATION_ASSUME_ABSTRACT(IProtocol)